
#include "TrackInfo.h"


const TrackInfo::Turns TrackInfo::analyzeTurn(CarState& cs)
{
	TrackInfo::Turns turn = TURN_NONE;


	if (cs.getTrack(9) >= 200.0f || cs.getTrack(8) < 43.0f || cs.getTrack(10) < 43.0f ||  (cs.getTrack(9) >= cs.getTrack(8) && cs.getTrack(9) >= cs.getTrack(10)))
		return turn;
	else
	{
		if (cs.getTrack(10) > cs.getTrack(8))
		{
			turn = TURN_RIGHT;
			//std::cout << "Right" << std::endl;
		}

		else if (cs.getTrack(8) > cs.getTrack(10))
		{
			turn = TURN_LEFT;
			//std::cout << "Left" << std::endl;
		}


	}

	 
	
	 
	return turn;
}
